<template>
  <div>
    <div class="share" @click="showShare = true">
      <img src="../assets/share.png" alt="" />
    </div>
    <van-share-sheet
      v-model="showShare"
      title="分享"
      :options="options"
      @select="onSelect"
    />
  </div>
</template>
<script>
export default {
  data() {
    return {
      showShare: false,
      options: [
        [
          { name: "微信好友", icon: "wechat" },
          {
            name: "朋友圈",
            icon: "http://qxkmdhmin.hn-bkt.clouddn.com/pyq.png",
          },
          { name: "微博", icon: "weibo" },
          { name: "QQ", icon: "qq" },
          {
            name: "QQ空间",
            icon: "http://qxkmdhmin.hn-bkt.clouddn.com/kongjian.png",
          },
          {
            name: "知乎",
            icon: "http://qxkmdhmin.hn-bkt.clouddn.com/zhihu1.png",
          },
        ],
        [{ name: "拷贝连接", icon: "link" }],
      ],
    };
  },
  methods: {
    onSelect(option) {
      Toast(option.name);
      this.showShare = false;
    },
  },
};
</script>
